{% extends "../base.html" %}
{% block content %}
<h2>
    <translate>Resin Profiles</translate> <a class="btn btn-default tip" href="/profile/add" role="button"><span
            class="glyphicon glyphicon-plus"></span><translate class="hide">Add a new resin profile</translate></a> 
            <a class="btn btn-default tip" href="/import"><span
            class="glyphicon glyphicon-import"></span><translate class="hide">Import a resin profile</translate></a>
</h2>
<table class="table table-striped table-bordered model-list">
    <thead>
        <tr>
            <th translate>Title</th>
            <th><span translate>Layer Thickness</span> <sup translate>Micron</sup></th>
            <th><span translate>Cure Time</span> <sup translate>Second</sup></th>
            <th translate>Default</th>
            <th translate>Actions</th>
        </tr>
    </thead>

    {% if profiles %}
    {% for profile in profiles %}
    <tr>
        <td>{{profile.Title}}</td>
        <td>{{profile.Depth|floatformat}}</td>
        <td>{{profile.CureTime|floatformat}}</td>
        <td>
            {% if defaultProfile==profile.ProfileID %}
            <span class="glyphicon glyphicon-ok text-success"></span>
            {% else %}
            <a class="btn btn-default tip" href="/profile/default/{{profile.ProfileID}}"><span
                    class="glyphicon glyphicon-ok"></span><translate class="hide">Set default resin profile</translate></a>
            {% endif %}
        </td>
        <td>
            <a class="btn btn-primary tip" href="/profile/edit/{{profile.ProfileID}}"><span
                    class="glyphicon glyphicon-pencil"></span><translate class="hide">Edit</translate></a>
            <a class="btn btn-danger ask tip" data-ask="delete-confirm" href="/profile/delete/{{profile.ProfileID}}"><span
                    class="glyphicon glyphicon-trash"></span><translate class="hide">Delete</translate></a>
            <a class="btn btn-default tip" href="/profile/clone/{{profile.ProfileID}}"><span
                    class="glyphicon glyphicon-duplicate"></span><translate class="hide">Clone</translate></a>
            <a class="btn btn-default tip" href="/profile/export/{{profile.ProfileID}}"><span
                    class="glyphicon glyphicon-export"></span><translate class="hide">Export</translate></a>
            <translate class="hide" id="delete-confirm">Are you sure you want to delete this profile?</translate>
        </td>
    </tr>
    {% endfor %}
    {% else %}
    <tr>
        <td colspan="999">
            <div class="text-center" translate>No Profile</div>
        </td>
    </tr>
    {% endif %}
</table>
<br>
{% endblock %}